package com.ruoyi.partybuilding.domain;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.partybuilding.common.EQuery.CU2Entity;
import com.ruoyi.partybuilding.common.EQuery.EQueryEntityLong;
import com.ruoyi.partybuilding.common.EQuery.ICreatorIdEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import com.easy.query.core.annotation.*;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

/**
 * 订单;
 * @author : He-LiangLiang@Outlook.com
 * @date : 2025-1-24
 */
@ApiModel(value = "订单",description = "")
@Table("pb_mall_order")
@Data
public class MallOrder extends CU2Entity.LongId implements ICreatorIdEntity.IUserId {
    @ApiModelProperty(value = "用户", notes = "")
    private Long userId;
    /**
     * 用户昵称
     */
    @ApiModelProperty(value = "用户昵称", notes = "")
    //@EasyWhereCondition(propName = "phonenumber",mode = EasyWhereCondition.Mode.MULTI_OR)
    private String userNickname;

    @EasyWhereCondition(propNames = {"orderNum","userNickname","phonenumber"},mode = EasyWhereCondition.Mode.MULTI_OR)
    @ApiModelProperty(value = "手机号", notes = "")
    String phonenumber;
    /**
     * 总价
     */
    @ApiModelProperty(value = "总价", notes = "")
    private Double totalPrice;
    /**
     * 商品
     */
    @NotBlank
    @Min(0)
    @ApiModelProperty(value = "商品", notes = "")
    private Long goodsId;
    /**
     * 商品名称
     */
    @ApiModelProperty(value = "商品名称", notes = "")
    @EasyWhereCondition
    private String goodsName;
    /**
     * 购买数量
     */
    @NotBlank
    @Min(0)
    @ApiModelProperty(value = "购买数量", notes = "")
    private Integer quantity;
    /**
     * 状态：1已完成
     */
    @ApiModelProperty(value = "状态：0待确认,1已完成", notes = "")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    private Integer status;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注", notes = "")
    private String reamrk;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.RANGE_LEFT_CLOSED)
    private Date createTime;


    //@EasyWhereCondition(propName = "phonenumber",mode = EasyWhereCondition.Mode.MULTI_OR)
    String orderNum;
    @ColumnIgnore
    @EasyWhereCondition(type = EasyWhereCondition.Condition.RANGE_RIGHT_CLOSED,propName = "createTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    Date createTime2;


}